fix: repair cross-package bugs so tests and typecheck pass - #90
Open
stooit wants to merge 1 commit into
Open
Conversation
- ui/Button: forward aria-label to the rendered <button> for accessible name - ui/DataTable: use functional updater to fix stale-closure sort direction; render rows when no sort is active - web/api: update renamed hook import (useThrottle -> useDebounce) and re-export as useSearchDebounce - utils/date: format en-AU day-first without leading zero - tsconfig: include bun-types so bun:test resolves under tsc --noEmit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all failing tests and type errors across the monorepo (
bun test→ 13/13 pass,tsc --noEmit→ 0 errors). Source/config only — no test files modified, no dependencies added.Fixes
packages/ui/src/components/Button/Button.tsx):Propsnow extendsReact.ButtonHTMLAttributes; passthrough props (incl.aria-label) are spread onto the<button>, giving icon-only buttons an accessible name.packages/ui/src/components/DataTable/DataTable.tsx): sort direction now uses a functional state updater (prev => ...), fixing the stale-closure bug on the second click; rows render from the full data set when no sort is active.apps/web/src/lib/api.ts): the hook was renamed inpackages/utilsfromuseThrottletouseDebounce; import/usage updated and re-exported asuseSearchDebounce(as the test expects).packages/utils/src/format/date.ts):en-AUformatting now renders day-first without a leading zero, so 1 March is1/03/2024(not01/03/2024).tsconfig.json): added"types": ["bun-types"]sobun:testresolves undertsc --noEmit(bun-types was already an installed devDependency; no new deps).Verification
bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts→ 13 pass, 0 failbun run typecheck(tsc --noEmit) → 0 errorsAssumptions
bun:testtype errors were resolved via tsconfigtypesrather than editing test files, per the "do not modify test files / no new dependencies" constraints.